.TH std::flat_map::values 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::flat_map::values \- std::flat_map::values

.SH Synopsis
   const mapped_container_type& values() const noexcept;  (since C++23)

   Return a constant reference to the adapted values container. Equivalent to return
   c.values;.

.SH Parameters

   \fI(none)\fP

.SH Return value

   The underlying values container.

.SH Complexity

   Constant.

.SH Example


// Run this code

 #include <flat_map>
 #include <print>
 #include <type_traits>
 #include <vector>

 int main()
 {
     std::flat_map<int, double> map{{1, 1.1}, {2, 2.2}, {3, 3.3}};

     // The default values container is std::vector:
     static_assert(std::is_same_v<decltype(map.values()), const std::vector<int>&>);

     std::println("{}", map.values());
 }

.SH Output:

 [1.1, 2.2, 3.3]

.SH See also

   keys direct access to the underlying keys container
        \fI(public member function)\fP
